package com.usian.utils.common;

import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;


/**
 * 字符串工具
 *
 * @author Crush
 * @date 2021/12/16
 */
@Slf4j
public class StringUtils {
    
    public static HashMap<String,String> subStringPath(String path){
        int i = path.indexOf("/");
        log.info("===>i:{}",i);
        String group = path.substring(0, i);
        String filePath = path.substring(i + 1);
        log.info("====>group:{},imaPath:{}",group,filePath);
        HashMap<String, String> map = new HashMap<>();
        map.put("group",group);
        map.put("path",filePath);
        return map;
    }

    public static String substringPath(String path){
        int i = path.indexOf("/", 8);
        String substring = path.substring(i + 1);
        System.out.println(substring);
        return substring;
    }

    public static void main(String[] args) {
        StringUtils.substringPath("http://192.168.200.130/group1/M00/00/00/wKjIgmG130yAZu1HAAuQY-Z8VfM320.jpg");
    }
}
